//
//  ShangYeViewController.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/2.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "ShangYeViewController.h"

#import "BuyViewController.h"
#import "SigningViewController.h"
@interface ShangYeViewController ()

@end

@implementation ShangYeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    self.view.backgroundColor = BgColor;
    NSArray *sigingArr = [NSArray arrayWithObjects:@"    我的认购",@"    我的签约", nil];
    NSArray *imArr = [NSArray arrayWithObjects:@"renchou",@"qianyue", nil];
    for (int i = 0; i<sigingArr.count; i++)
    {
        UIButton *mgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        mgBtn.frame = CGRectMake(0,  2+i*51, B_WIDTH, 50);
        mgBtn.backgroundColor = [UIColor whiteColor];
      
        [mgBtn setTitle:sigingArr[i] forState:0];
        mgBtn.tag = 30+i;
        [mgBtn setImage:[UIImage imageNamed:imArr[i]] forState:0];
        //[btn layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:30];
        mgBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//左对齐
        [mgBtn setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 5, 100)];
        
        [mgBtn setTitleColor:[UIColor colorWithHexString:@"#ff8300"] forState:0];
        mgBtn.titleLabel.font = [UIFont systemFontOfSize:18];
        [mgBtn addTarget:self action:@selector(mgBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:mgBtn];
        
    }
    
    
    
}

-(void)mgBtnClick:(UIButton *)btn
{
    if (btn.tag == 30)
    {
        BuyViewController *buyVC = [[BuyViewController alloc] init];
        [self.navigationController pushViewController:buyVC animated:NO];
        
    }
    if (btn.tag == 31)
    {
        SigningViewController *signingVC = [[SigningViewController alloc] init];
        [self.navigationController pushViewController:signingVC animated:NO];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
